{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from lammps_interface.lammps_main import LammpsSimulation\n",
    "from lammps_interface.structure_data import from_CIF, write_CIF"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "class Parameters:\n",
    "    def __init__(self, cif):\n",
    "        # File options\n",
    "        self.cif_file = cif\n",
    "        self.output_cif = False\n",
    "        self.output_raspa = False\n",
    "\n",
    "        # Force field options\n",
    "        self.force_field = 'UFF'\n",
    "        self.mol_ff = None\n",
    "        self.h_bonding = False\n",
    "        self.dreid_bond_type = 'harmonic'\n",
    "        self.fix_metal = False\n",
    "        \n",
    "        # Simulation options\n",
    "        self.minimize = False\n",
    "        self.bulk_moduli = False\n",
    "        self.thermal_scaling = False\n",
    "        self.npt = False\n",
    "        self.nvt = False\n",
    "        self.cutoff = 12.5\n",
    "        self.replication = None\n",
    "        self.orthogonalize = False\n",
    "        self.random_vel = False\n",
    "        self.dump_dcd = 0\n",
    "        self.dump_xyz = 0\n",
    "        self.dump_lammpstrj = 0\n",
    "        self.restart = False\n",
    "        \n",
    "        # Parameter options\n",
    "        self.tol = 0.4\n",
    "        self.neighbour_size = 5\n",
    "        self.iter_count = 10\n",
    "        self.max_dev = 0.01\n",
    "        self.temp = 298.0\n",
    "        self.pressure = 1.0\n",
    "        self.nprodstp = 200000\n",
    "        self.neqstp = 200000\n",
    "        \n",
    "        # Molecule insertion options\n",
    "        self.insert_molecule = \"\"\n",
    "        self.deposit = 0\n",
    "        \n",
    "    def show(self):\n",
    "        for v in vars(self):\n",
    "            print('%-15s: %s' % (v, getattr(self, v)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "par = Parameters('../test_struct/IRMOF-1.cif')\n",
    "par.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "sim = LammpsSimulation(par)\n",
    "cell, graph = from_CIF(par.cif_file)\n",
    "sim.set_cell(cell)\n",
    "sim.set_graph(graph)\n",
    "sim.split_graph()\n",
    "sim.assign_force_fields()\n",
    "sim.compute_simulation_size()\n",
    "sim.merge_graphs()\n",
    "if par.output_cif:\n",
    "    print(\"CIF file requested. Exiting...\")\n",
    "    write_CIF(graph, cell)\n",
    "    sys.exit()\n",
    "\n",
    "sim.write_lammps_files()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
